package com.dongge.service;

import com.dongge.dao.CURDDaoBase;
import com.dongge.entity.Department1;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2015/11/3.
 */
@Service
public class Department1Service extends CURDDaoBase<Department1> {

    /**
     * 获取父节点下目录列表
     * @param parentId
     * @return
     */
//    public List<Department1> findDepartmentsByParentId(Long parentId){
//        if(parentId == null)
//        {
//            String hsql = "from Department d where d.parent is null order by d.name desc";
//            return getSession().createQuery(hsql)
//                    .list();
//        }
//        String hsql = "from Department d where d.parent.id = :id order by d.name desc";
//        return getSession().createQuery(hsql)
//                .setLong("id",parentId)
//                .list();
//    }
}
